package com.yl.auth.controller;


import com.yl.auth.entity.*;
import com.yl.auth.service.*;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ln
 * @since 2023-07-11
 */
@RestController
@RequestMapping("/admin/auth/qingdu")
@Api(tags = "基础设置-配置服务项目")
public class QingduController {
    @Resource
    //轻度
    private QingduService qingduService;
    @Resource
    //中度
    private ZhongdService zhongdService;
    @Resource
    //重度
    private ZhongduService zhongduService;
    @Resource
    //护理项目
    private HulixiangmuService hulixiangmuService;
    //护工服务
    @Resource
    private HugongfuwuService hugongfuwuService;

    @ApiOperation(value = "根据id查询护理项目信息----配置服务")
    @GetMapping("/get/{id}")
    public Result get(@PathVariable Integer id){
        HulixiangmuBean byId = hulixiangmuService.getById(id);
        return Result.ok(byId);
    }
//    @ApiOperation(value = "根据id查询轻度集合")
//    @GetMapping("/getqingdulist/{id}")
//    public Result getqingdulist(@PathVariable Integer id){
//       List<Qingdu> list1=qingduService.findqingdu(id);
//        return Result.ok(list1);
//    }
//    @ApiOperation(value = "根据id查询中度集合")
//    @GetMapping("/getzhongdlist/{id}")
//    public Result getzhongdlist(@PathVariable Integer id){
//        List<Zhongd> list2=zhongdService.findzhongd(id);
//        return Result.ok(list2);
//    }
//    @ApiOperation(value = "根据id查询重度集合")
//    @GetMapping("/getzhongdulist/{id}")
//    public Result getzhongdulist(@PathVariable Integer id){
//        List<Zhongdu> list3=zhongduService.findzhongdu(id);
//        return Result.ok(list3);
//    }
//    @ApiOperation(value = "查询轻度没有选的服务项目")
//    @PostMapping("/findfuwu")
//    public Result findfuwu(HugongfuwuBean hugongfuwuBean){
//        List<HugongfuwuBean> hugongfuwuBeanlist=hugongfuwuService.findfuwuList(hugongfuwuBean);
//        return Result.ok(hugongfuwuBeanlist);
//    }
//    @ApiOperation(value = "查询中度没有选的服务项目")
//    @PostMapping("/findfuwuzhongd")
//    public Result findfuwuzhongd(HugongfuwuBean hugongfuwuBean){
//        List<HugongfuwuBean> hugongfuwuBeanlist2=hugongfuwuService.findzhongdList(hugongfuwuBean);
//        return Result.ok(hugongfuwuBeanlist2);
//    }
//    @ApiOperation(value = "查询重度没有选的服务项目")
//    @PostMapping("/findfuwuzhongdu")
//    public Result findfuwuzhongdu(HugongfuwuBean hugongfuwuBean){
//        List<HugongfuwuBean> hugongfuwuBeanlist3=hugongfuwuService.findzhongduuList(hugongfuwuBean);
//        return Result.ok(hugongfuwuBeanlist3);
//    }
//    @ApiOperation(value = "添加轻度服务项目")
//    @PostMapping("/addqingdu/{id}")
//    public Result addqingdu(@RequestBody List<Long> ids, @PathVariable Long id){
//        HulixiangmuBean byId = hulixiangmuService.getById(id);
//        Qingdu qingdu=new Qingdu();
//        qingdu.setHuId(byId.getId());
//        long o=1;
//        qingdu.setDengjiId(o);
//        for (Long i : ids) {
//            HugongfuwuBean byId1 = hugongfuwuService.getById(i);
//            qingdu.setName(byId1.getName());
//            qingduService.save(qingdu);
//        }
//        return Result.ok();
//    }
//    @ApiOperation(value = "添加中度服务项目")
//    @PostMapping("/addzhongd/{id}")
//    public Result addzhongd(@RequestBody List<Long> ids, @PathVariable Long id){
//        HulixiangmuBean byId = hulixiangmuService.getById(id);
//        Zhongd zhongd=new Zhongd();
//        zhongd.setHuId(byId.getId());
//        long o=2;
//        zhongd.setDengjiId(o);
//        for (Long i : ids) {
//            HugongfuwuBean byId1 = hugongfuwuService.getById(i);
//            zhongd.setName(byId1.getName());
//            zhongdService.save(zhongd);
//        }
//        return Result.ok();
//    }
//    @ApiOperation(value = "添加中度服务项目")
//    @PostMapping("/addzhongdu/{id}")
//    public Result addzhongdu(@RequestBody List<Long> ids, @PathVariable Long id){
//        HulixiangmuBean byId = hulixiangmuService.getById(id);
//        Zhongdu zhongdu=new Zhongdu();
//        zhongdu.setHuId(byId.getId());
//        long o=3;
//       zhongdu.setDengjiId(o);
//        for (Long i : ids) {
//            HugongfuwuBean byId1 = hugongfuwuService.getById(i);
//            zhongdu.setName(byId1.getName());
//            zhongduService.save(zhongdu);
//        }
//        return Result.ok();
//    }
//    @ApiOperation(value = "删除轻度服务项目")
//    @DeleteMapping("/removeqingdu/{id}")
//    public Result removeqingdu(@PathVariable Integer id){
//        qingduService.removeById(id);
//        return Result.ok();
//    }
//    @ApiOperation(value = "删除中度服务项目")
//    @DeleteMapping("/removezhongd/{id}")
//    public Result removezhongd(@PathVariable Integer id){
//        zhongdService.removeById(id);
//        return Result.ok();
//    }
//    @ApiOperation(value = "删除重度服务项目")
//    @DeleteMapping("/removezhongdu/{id}")
//    public Result removezhongdu(@PathVariable Integer id){
//        zhongduService.removeById(id);
//        return Result.ok();
//    }
}

